package com.lh.web.service.impl.banner;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.lh.common.entity.admin.Banner;
import com.lh.common.entity.admin.BannerDetail;
import com.lh.common.utils.PageUtils;
import com.lh.web.dao.admin.BannerMapper;
import com.lh.web.service.serviceAdmin.banner.BannerService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author FH
 * @ClassName: BannerServiceImpl
 * @Description: (类作用)
 * @date: 2020-05-08 16:58
 */
@Service
public class BannerServiceImpl extends ServiceImpl<BannerMapper, Banner> implements BannerService {

    @Override
    public PageUtils queryBannerList(Map<String, Object> param, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<Banner> notices = this.baseMapper.queryBannerList(param);
        return new PageUtils(notices);
    }

    @Override
    public BannerDetail queryBannerById(Long bannerId, String type, String banner) {
        return this.baseMapper.queryBannerById(bannerId,type,banner);
    }

    @Override
    public int insertBanner(BannerDetail bannerDetail) {
        return this.baseMapper.insertBanner(bannerDetail);
    }

    @Override
    public int updateBanner(BannerDetail bannerDetail) {
        return this.baseMapper.updateBanner(bannerDetail);
    }

    @Override
    public int deleteBanner(Long[] bannerIds) {
        return this.baseMapper.deleteBanner(bannerIds);
    }

    @Override
    public int selectBanner() {
        return this.baseMapper.selectBanner();
    }

    @Override
    public int updateBannerStatus(Map<String, Object> param) {
        return this.baseMapper.updateBannerStatus(param);
    }

    @Override
    public int queryBanner(Long aid) {
        return this.baseMapper.queryBanner(aid);
    }

    @Override
    public Map<String, Object> queryShopStatus(String shopType,String sid) {
        return this.baseMapper.queryShopStatus(shopType,sid);
    }
}
